package com.mes.code.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;

//import com.mes.basicdata.extend.domain.Attribute;
import com.mes.common.domain.BasicModel;



/**
 * CSnfeature generated by MyEclipse Persistence Tools
 *author lcs
 *data 2017-03-29
 */
@Entity()
//@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name = "C_SNFEATURE")
@BatchSize(size=10)
//@Lazy(value=true)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class SerialNumberFeature extends BasicModel implements Serializable {
	
	@Id
	@GenericGenerator(name = "sfUid", strategy = "assigned")
	@Column(name = "SFUID")
	private String sfUid;
	
	@Override
	public String getUuid() {
		return sfUid;
	}

	@Override
	public void setUuid(String uuid) {
		this.sfUid = uuid;
	}
	

	public String getSfUid() {
		return sfUid;
	}

	public void setSfUid(String sfUid) {
		this.sfUid = sfUid;
	}


	// Fields
	@Column(name="ATTRIBUTE_UID",length=50)
	private String attributeUid;
	
//	//many-to-one
//	@ForeignKey(name="null")
//	@ManyToOne(fetch=FetchType.LAZY)
//	@JoinColumn(name="SUPERDEPTID",insertable=false,updatable=false)
//	private Attribute attribute;
	
	@Column(name="CRUID",length=50)
	private String codeRuleUid;
	
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="CRUID",insertable=false,updatable=false)
	private CodeRule codeRule;
	
	@Column(name="SEQUENCE",length=50)
	private Integer sequence;
	
	@Column(name="SFType",length=50)
	private String serialNumberFeatureType;
	@Column(name="CREATTIME",length=6)
	private Date creatTime;
	

	
	public Date getCreatTime() {
		return creatTime;
	}

	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}

	public final static String FEATURETYPE_CRITICAL="1";
	public final static String FEATURETYPE_NOT_CRITICAL="0";

	public String getCodeRuleUid() {
		return codeRuleUid;
	}

	public void setCodeRuleUid(String codeRuleUid) {
		this.codeRuleUid = codeRuleUid;
	}

	public Integer getSequence() {
		return sequence;
	}

	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}

	public CodeRule getCodeRule() {
		return codeRule;
	}

	public void setCodeRule(CodeRule codeRule) {
		this.codeRule = codeRule;
	}

	public String getAttributeUid() {
		return attributeUid;
	}

	public void setAttributeUid(String attributeUid) {
		this.attributeUid = attributeUid;
	}

//	public Attribute getAttribute() {
//		return attribute;
//	}
//
//	public void setAttribute(Attribute attribute) {
//		this.attribute = attribute;
//	}

	public String getSerialNumberFeatureType() {
		return serialNumberFeatureType;
	}

	public void setSerialNumberFeatureType(String serialNumberFeatureType) {
		this.serialNumberFeatureType = serialNumberFeatureType;
	}

}